<?php
header("Content-Type:text/html;charset=utf-8");
//引入连接数据库文件 require
require './lib/init.php';
$art_id = isset($_GET['art_id']) ? trim($_GET['art_id']) : '';
//判断$cat_id是否为数字
if (!is_numeric($art_id)) {
  echo "文章id不合法(必须是数字)";
  exit();
}
// echo "<script>alert($art_id)</script>"; 获取到了内容
if (empty($_POST)) {
  $sql = "select art.*,cat.catname from art left join cat on art.cat_id = cat.cat_id where art.art_id=$art_id";
  $data = mQuery($sql);
  $category = "select * from cat";
  $dataC = mGetAll($category);
  // var_dump($data);
  require './view/front/art.html';
} else {
  //做提交评论操作
}
